package shapes.shapes2D.distribution.poissondisk 
{
	/**
	 * ...
	 * @author Nicolas Barradeau
	 * http://en.nicoptere.net
	 */
	public class Bitmap
	{
		
		public function Bitmap() 
		{
			
		}
		var test_width:uint = 1 + dist * 2;
var x:Number;
var y:Number;
if (dist_iteration < Math.pow(test_width,2)) {
	do {
	x = (dist_iteration % test_width) - dist;
	y = Math.floor(dist_iteration / test_width) - dist;
	dist_iteration++;
	}
	while(Math.abs(x)
		
		public static function check(shape:Shape,bitmapData:BitmapData):Boolean {
	var tempBmpData:BitmapData = new BitmapData(shape.width, shape.height, true, 0xFFFFFF);
	var matrix:Matrix = new Matrix();
	var rotation:Number = 2 * Math.PI * (shape.rotation / 360);
	matrix.rotate(rotation);
	matrix.translate(shape.width/2, shape.height/2);
	tempBmpData.draw(shape,matrix);
 
	var tempBmpDataSource:BitmapData = new BitmapData(shape.width, shape.height, true, 0xFFFFFF);
	var matrix2:Matrix = new Matrix();
	matrix2.translate(-shape.x+shape.width/2,-shape.y+shape.height/2);
	tempBmpDataSource.draw(bitmapData, matrix2);
 
	var empty:Boolean = tempBmpData.hitTest(new Point(0, 0), 0xFF, tempBmpDataSource, new Point(0, 0), 0xFF);
	tempBmpData.dispose();
	tempBmpDataSource.dispose();
 
	return(empty)
}
	}

}